home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d939.lha / ExtraCmds / source_etc.lha / src / myprintf.c < prev    next >
C/C++ Source or Header  |  1993-10-22  |  2KB  |  63 lines

  1. /*   ---------------------------------      -------     
  2.  *   |\  | | | | |  |.| |   \|  |/ /|\      |||||||     
  3.  *   | | | |/  | |\ |/  |/|  |\ |/  |    ?  ---+---  =< 
  4.  *   | | | |   | |  |     |  |  |   |     \qqqqqqqqq/   
  5.  *   ---------------------------------  ~~~~~~~~~~~~~~~~
  6.  *  varargs interface to dos.library/VPrintf()
  7.  *  Copyright (C) 1993 Torsten Poulin
  8.  *
  9.  *  This file is part of "Torsten's AmigaDOS Shell Commands" package.
  10.  *  The package is free software; you can redistribute it and/or modify
  11.  *  it under the terms of the GNU General Public License as published by
  12.  *  the Free Software Foundation; either version 2 of the License, or
  13.  *  (at your option) any later version.
  14.  *
  15.  *  The package is distributed in the hope that it will be useful,
  16.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  *  GNU General Public License for more details.
  19.  *
  20.  *  You should have received a copy of the GNU General Public License
  21.  *  along with this program; if not, write to the Free Software
  22.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  *
  24.  *  The author can be contacted by s-mail at
  25.  *    Torsten Poulin
  26.  *    Banebrinken 99, 2, 77
  27.  *    DK-2400 Copenhagen NV
  28.  *    DENMARK
  29.  *
  30.  * $Id: myprintf.c,v 1.2 93/03/01 12:58:10 Torsten Rel $
  31.  * $Log:    myprintf.c,v $
  32.  * Revision 1.2  93/03/01  12:58:10  Torsten
  33.  * Changed all occurrences of "struct DosBase *" to "struct DosLibrary *"
  34.  * 
  35.  * Revision 1.1  93/03/01  11:01:56  Torsten
  36.  * Initial revision
  37.  * 
  38.  */
  39.  
  40. #include <exec/types.h>
  41. #include <dos/dos.h>
  42. #include <clib/dos_protos.h>
  43. #ifdef __SASC
  44. #include <pragmas/dos_pragmas.h>
  45. #endif
  46. #include <stdarg.h>
  47.  
  48. struct Global {
  49.   struct DosLibrary *DOSBase;
  50. };
  51.  
  52. LONG MyPrintf(VOID *global, char *fmt, ...)
  53. {
  54.   struct DosLibrary *DOSBase = ((struct Global *) global)->DOSBase;
  55.   va_list ap;
  56.   LONG    num;
  57.  
  58.   va_start(ap, fmt);
  59.   num = VPrintf(fmt, (LONG *) ap);
  60.   va_end(ap);
  61.   return num;
  62. }
  63.